package com.kcnet.qk.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.kcnet.qk.activity.MainActivity;
import com.kcnet.qk.util.ToastUtil;

import cn.jesse.nativelogger.NLogger;

/**
 * Created by Administrator on 2017-06-19.
 */
public class BootBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        NLogger.d("BootBroadcastReceiver","BootBroadcastReceiver:"+intent.getAction());

            ToastUtil.showToast(context,intent.getAction());
            Intent bootIntent = new Intent(context, MainActivity.class);  // 要启动的Activity
            bootIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(bootIntent);
    }
}